package com.ruoyi.boc.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.boc.mapper.BocActivityPublishMapper;
import com.ruoyi.boc.domain.BocActivityPublish;
import com.ruoyi.boc.service.IBocActivityPublishService;

/**
 * 活动发布Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-18
 */
@Service
public class BocActivityPublishServiceImpl implements IBocActivityPublishService
{
    @Autowired
    private BocActivityPublishMapper ismActivityPublishMapper;

    /**
     * 查询活动发布
     * 
     * @param activityId 活动发布主键
     * @return 活动发布
     */
    @Override
    public BocActivityPublish selectBocActivityPublishByActivityId(Long activityId)
    {
        return ismActivityPublishMapper.selectBocActivityPublishByActivityId(activityId);
    }

    /**
     * 查询活动发布列表
     * 
     * @param ismActivityPublish 活动发布
     * @return 活动发布
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<BocActivityPublish> selectBocActivityPublishList(BocActivityPublish ismActivityPublish)
    {
        return ismActivityPublishMapper.selectBocActivityPublishList(ismActivityPublish);
    }

    /**
     * 新增活动发布
     * 
     * @param ismActivityPublish 活动发布
     * @return 结果
     */
    @Override
    public int insertBocActivityPublish(BocActivityPublish ismActivityPublish)
    {
        ismActivityPublish.setCreateTime(DateUtils.getNowDate());
        return ismActivityPublishMapper.insertBocActivityPublish(ismActivityPublish);
    }

    /**
     * 修改活动发布
     * 
     * @param ismActivityPublish 活动发布
     * @return 结果
     */
    @Override
    public int updateBocActivityPublish(BocActivityPublish ismActivityPublish)
    {
        ismActivityPublish.setUpdateTime(DateUtils.getNowDate());
        return ismActivityPublishMapper.updateBocActivityPublish(ismActivityPublish);
    }

    /**
     * 批量删除活动发布
     * 
     * @param activityIds 需要删除的活动发布主键
     * @return 结果
     */
    @Override
    public int deleteBocActivityPublishByActivityIds(Long[] activityIds)
    {
        return ismActivityPublishMapper.deleteBocActivityPublishByActivityIds(activityIds);
    }

    /**
     * 删除活动发布信息
     * 
     * @param activityId 活动发布主键
     * @return 结果
     */
    @Override
    public int deleteBocActivityPublishByActivityId(Long activityId)
    {
        return ismActivityPublishMapper.deleteBocActivityPublishByActivityId(activityId);
    }
}
